package com.loop.stringDemo;

import java.util.Random;

/**
 * String类的改型方法
 */
public class StringChangeDemo {
    public static void main(String[] args) {
        String s = "abcd";
        byte[] b = s.getBytes();
        for (int i = 0; i < b.length; i++) {
            System.out.println(b[i]+" ");
        }

        String c = "hello";
        char[] ch  = c.toCharArray();
        System.out.println(ch);

        String d = "HelloWorld";
        String d2 = d.toUpperCase();
        System.out.println(d2);

        System.out.println(d2.toLowerCase());

        System.out.println(String.valueOf(3.13)+String.valueOf(6));

        Random random = new Random();
        System.out.println(String.valueOf(random.nextInt(10)));
        toUpper();
    }

    public static void toUpper(){
        String a = "I LoVE JaVA";
        String before = a.substring(0,1);
        String after = a.substring(1);
        System.out.println(before);
        System.out.println(after);
        System.out.println(before.toUpperCase()+after.toLowerCase());

    }
}
